package mx.messaging;

extern class ChannelSet extends flash.events.EventDispatcher {
	var authenticated(default,null) : Bool;
	var channelIds(default,null) : Array<Dynamic>;
	var channels : Array<Dynamic>;
	var clustered : Bool;
	var connected(default,null) : Bool;
	var currentChannel(default,null) : Channel;
	var messageAgents(default,null) : Array<Dynamic>;
	function new(?channelIds : Array<Dynamic>, ?clusteredWithURLLoadBalancing : Bool) : Void;
	function addChannel(channel : Channel) : Void;
	function channelConnectHandler(event : mx.messaging.events.ChannelEvent) : Void;
	function channelDisconnectHandler(event : mx.messaging.events.ChannelEvent) : Void;
	function channelFaultHandler(event : mx.messaging.events.ChannelFaultEvent) : Void;
	function connect(agent : MessageAgent) : Void;
	function disconnect(agent : MessageAgent) : Void;
	function disconnectAll() : Void;
	function login(username : String, password : String, ?charset : String) : mx.rpc.AsyncToken;
	function logout(?agent : MessageAgent) : mx.rpc.AsyncToken;
	function removeChannel(channel : Channel) : Void;
	function send(agent : MessageAgent, message : mx.messaging.messages.IMessage) : Void;
	function setCredentials(credentials : String, agent : MessageAgent, ?charset : String) : Void;
	private function setConnected(value : Bool) : Void;
}
